home *** CD-ROM | disk | FTP | other *** search
/ The Business Master (3rd Edition) / The Business Master (3rd Edition).iso / files / wordmisc / orphes3 / manual2.doc < prev    next >
Encoding:
Text File  |  1993-02-09  |  67.3 KB  |  1,921 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.                               Orpheus User's Guide
  12.  
  13.  
  14.                                   * Part II *
  15.  
  16.  
  17.  
  18.                           THE ORPHEUS COMMAND LANGUAGE
  19.  
  20.  
  21.  
  22.  
  23.  
  24.                         Copyright 1992 Hyperion Softword
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.                                        1
  60.  
  61.  
  62.  
  63.  
  64.   ---------------------------------------------------------------------------
  65.                         T A B L E  O F  C O N T E N T S
  66.   ---------------------------------------------------------------------------
  67.  
  68.  
  69.  
  70.  Chapter 1  -  Programming Hypertext ................................... 3
  71.     Init Cards ......................................................... 3
  72.     Action Cards ....................................................... 4
  73.     Graphic Cards ...................................................... 4
  74.     Orpheus Command Language ........................................... 5
  75.         Syntax ......................................................... 5
  76.         Flow Control ................................................... 6
  77.         Parameters ..................................................... 6
  78.         Variables ...................................................... 7
  79.     Testing Commands & Scripts ......................................... 7
  80.  
  81.  Chapter 2  -  Converting Pre-1.30 Commands ............................ 8
  82.     Graphic Commands ................................................... 8
  83.     Run Commands ....................................................... 10
  84.     Random Commands .................................................... 10
  85.  
  86.  Chapter 3  -  Programming Command Reference ........................... 11
  87.     :[label] ........................................................... 11
  88.     Ansi ............................................................... 12
  89.     Goto ............................................................... 12
  90.     Graphic ............................................................ 13
  91.     Hide ............................................................... 15
  92.     Hotspot ............................................................ 16
  93.     If ................................................................. 18
  94.     Jump ............................................................... 19
  95.     Jumplist ........................................................... 20
  96.     Message ............................................................ 22
  97.     Netwk .............................................................. 22
  98.     Play ............................................................... 23
  99.     Quit ............................................................... 25
  100.     Run ................................................................ 26
  101.     Runbat ............................................................. 26
  102.     Set ................................................................ 27
  103.     Trymode ............................................................ 30
  104.     Waitfor ............................................................ 31
  105.  
  106.  Table 1  -  Modes and Resolutions ..................................... 32
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.                                        2
  120.  
  121.  
  122.  
  123.  
  124.   ---------------------------------------------------------------------------
  125.                       CHAPTER 1  -  PROGRAMMING HYPERTEXT 
  126.   ---------------------------------------------------------------------------
  127.  
  128.  
  129.  
  130.  Topics in this chapter:  Init Cards
  131.                           Action Cards
  132.                           Graphic Cards
  133.                           Orpheus Command Language
  134.                              Syntax
  135.                              Flow Control
  136.                              Parameters
  137.                              Variables
  138.                           Testing Commands & Scripts
  139.  
  140.  
  141.  
  142.         NOTE:  Users who are upgrading from a version of Orpheus prior to 
  143.     1.30, and who have used the earlier commands to display graphics or play 
  144.     music, will need to update their work to the new language standard.  
  145.     Please see Chapter 2, "Converting Pre-1.30 Commands".
  146.     
  147.         If you wish to display graphics, play music, or launch external 
  148.     programs, you will appreciate the power and flexibility of the Orpheus 
  149.     Command Language.  First released with Version 1.30 of Orpheus, OCL 
  150.     provides the ability to write anything from a one-line jump command to a 
  151.     miniature program complete with hardware tests, multiple branches, timed 
  152.     pauses, even a slide show.  Future releases will add more commands, with 
  153.     the emphasis on multimedia and user interaction. 
  154.     
  155.         There are three types of link that lead to programmable cards:  Init, 
  156.     Action, and Graphic links.  Only these cards are programmable, and 
  157.     whatever you write on them will be *performed* rather than being displayed 
  158.     as text when your work is viewed with the Orpheus Reader.  Unlike normal 
  159.     text cards, where only the top 24 or 25 lines will be seen in the Reader, 
  160.     with programmable cards you can you use the entire workspace and be sure 
  161.     that every line will be compiled into your finished work.  
  162.     
  163.         In this chapter we will explore the uses, syntax, and vocabulary of 
  164.     the Orpheus Command Language.  In the next chapter you will find a 
  165.     thorough presentation of every command, together with extensive examples. 
  166.  
  167.  
  168.  Init Cards
  169.  
  170.         Inits are created by opening the Link Menu while in any text card
  171.     and selecting "Init".  Only text cards can have Inits, and they may have
  172.     only one each.  (Text cards include the Homecard and all cards attached
  173.     to Door, Note, or More links.)  When you are in a card that has an Init,
  174.     you can jump to it (in OH.EXE) either by pressing <Alt-I> or by opening
  175.     the Link Menu and selecting "Edit Init".
  176.  
  177.  
  178.  
  179.                                        3
  180.  
  181.  
  182.  
  183.  
  184.         When the Orpheus Reader loads a card that has an Init, it loads the
  185.     Init in the background and performs its commands before displaying the
  186.     Init's parent.  For example, an Init off the Homecard might contain a
  187.     graphical book-cover:  commands to display one or more graphics, or even a 
  188.     choice of graphics or ansi graphics depending on the user's hardware. 
  189.     Inits are processed every time the user enters a card that has one -- with 
  190.     the sole exception of the Homecard, whose Init (if any) is only processed
  191.     once.  
  192.  
  193.         After the last command in an Init, control returns to its parent;
  194.     normally this means that the text card is displayed and the user regains
  195.     the ability to navigate.  The exception is when the last command processed
  196.     is a jump() command, i.e. an instruction to go to a different card.  In
  197.     that case the Reader loads the new card and displays that, unless it too
  198.     has an Init that must be processed first.
  199.  
  200.         Aside from enabling you to do opening sequences, Inits are good places
  201.     to set variables and declare data automatically.  (These aspects will
  202.     expand considerably as the language evolves.)  Inits cannot contain links 
  203.     to other cards, nor can a graphic displayed from an Init contain hotspots. 
  204.  
  205.  
  206.  Action Cards 
  207.  
  208.         Action cards are created by opening an Action link on a word or phrase 
  209.     in any text card.  In OH.EXE you can jump to an Action card the same as 
  210.     you would to any card that is accessed through a linkword. 
  211.  
  212.         In the Orpheus Reader, when the user clicks on an Action linkword the
  213.     Action card is loaded in the background and its commands are processed.
  214.     After the last command, control returns immediately to the parent card. If 
  215.     a graphic or ansi graphic was displayed, or if an external program was 
  216.     launched, the parent card is displayed afresh.  The exception is if the 
  217.     last command processed is a jump() command, i.e. an instruction to go to a 
  218.     different card.  In that case the Reader loads and displays the new card. 
  219.     
  220.         Action cards cannot contain links to other cards, nor can a graphic 
  221.     displayed from an Action card contain hotspots. 
  222.  
  223.  
  224.  Graphic Cards 
  225.  
  226.         Graphic cards are created by opening a Graphic link on a word or 
  227.     phrase in any text card.  You can jump to a Graphic card the same as you 
  228.     would to any card that is accessed through a linkword.  When you do so in 
  229.     OH.EXE you go to the Graphic card itself, not to whatever you intend to 
  230.     display with it.  But when you jump to a Graphic in the Orpheus Reader you 
  231.     really do jump to what is intended for display.
  232.     
  233.         Like an Init or Action card, a Graphic card may contain anything from 
  234.     a single command to a script of tests and branches that display a suitable 
  235.     graphic or ansi graphic depending on the capabilities of the user's 
  236.  
  237.  
  238.  
  239.                                        4
  240.  
  241.  
  242.  
  243.  
  244.     hardware.  A Graphic card may even contain a sequence of multiple graphics 
  245.     separated by timed delays.  Unlike Init and Action cards, when the last 
  246.     command on a Graphic card is processed in the Reader, assuming that a 
  247.     graphic or ansi graphic is onscreen, control remains in the Graphic card 
  248.     the same as it would in a text card.  That is, the mouse pointer appears, 
  249.     the user can open the menu or use the titlebar, and if the graphic has 
  250.     hotspots he can navigate through them.  
  251.     
  252.         If you have selected "Graphic Titlebar" on the Project Menu, the 
  253.     Orpheus Reader's titlebar will appear automatically atop the last graphic 
  254.     or ansi graphic displayed from a Graphic card.  If this option was not 
  255.     selected, the titlebar only appears when the user moves the mouse pointer 
  256.     to the top of the screen. 
  257.  
  258.         Graphic cards may contain hotspots with links to other graphics or to 
  259.     text cards, with the following restrictions:  (1) hotspots can only be 
  260.     made for real graphics, not for ansi graphics; (2) the linkword in a 
  261.     hotspot() command may receive a Door link or a Graphic link, but no other 
  262.     kind.  Graphic cards may not have Inits or More links.  A jump() command 
  263.     in a Graphic card will either be rejected by the compiler or ignored by 
  264.     the Reader. 
  265.     
  266.         If by the last command in a Graphic card a graphic or ansi graphic is 
  267.     NOT onscreen, the Orpheus Reader assumes that an error has occurred and 
  268.     returns automatically to the parent card. 
  269.     
  270.  
  271.  Orpheus Command Language
  272.  
  273.         If you have ever written a batch file or used any other programming 
  274.     language, you will soon recognize how to get things done in Orpheus 
  275.     Command Language.  Even if you have never programmed at all, you will find 
  276.     it easy to accomplish what you need by using the examples given in the 
  277.     next chapter. 
  278.     
  279.     SYNTAX 
  280.     Here are the basic rules of OCL: 
  281.  
  282.         * Command lines:  commands must begin at the leftmost column.  The 
  283.           examples in this manual are indented to enhance readability; in
  284.           Orpheus they would be ignored unless shifted to the left of the
  285.           screen. 
  286.  
  287.         * Comment lines:  lines beginning with a "/" or ";" are considered
  288.           to be comment lines and are ignored by the command processor (and
  289.           the compiler).  Additionally, lines beginning with a space are
  290.           ignored unless they are carried-over data from a preceding command.
  291.  
  292.         * Commands may be entered in any combination of upper and lower case.
  293.           To enhance readability, the examples in this manual use lowercase
  294.           for commands and uppercase for labels, but you do not have to do
  295.           the same.  (Music strings however must be in uppercase.)
  296.  
  297.  
  298.  
  299.                                        5
  300.  
  301.  
  302.  
  303.  
  304.         * Within a command line, spaces may be used for readability, but are
  305.           not required.  The two examples below are equally valid:
  306.          
  307.                 set(fadein=tunnelin,fadeout=venetian,delay=1) 
  308.                 set ( fadein = tunnelin, fadeout = venetian, delay = 1 ) 
  309.     
  310.  
  311.     FLOW CONTROL 
  312.     The sum of the commands in a programmable card is called a "script".  
  313.     Sometimes a script may consist of a single command, such as "jump 
  314.     (retrace)" in an Action card to return the reader to wherever he came 
  315.     from.  More often however you will write a sequence of commands that may 
  316.     include various possible things that you would like to happen depending on 
  317.     circumstances.  The following example displays one of 3 possible screens 
  318.     in a Graphic card; which screen is chosen depends on whether the user has 
  319.     a VGA display, an EGA display, or neither. 
  320.     
  321.         trymode (19)                     // 1: Can we do VGA mode 19?
  322.         if (failed) goto NEXT            // 2: If not go to line 5.
  323.         graphic (vga_pic.pcx, 19, full)  // 3: Show fullscreen VGA graphic.
  324.         goto END                         // 4: Go to line 12.
  325.         :NEXT                            // 5: Label for goto command.
  326.         trymode (16)                     // 6: Can we do EGA mode 16?
  327.         if (failed) goto TEXT            // 7: If not go to line 10.
  328.         graphic (ega_pic.pcx, 16, full)  // 8: Show fullscreen EGA graphic.
  329.         goto END                         // 9: Go to line 12.
  330.         :TEXT                            // 10: Label for goto command.
  331.         ansi (ansi_pic.ans)              // 11: Show an ansi graphic.
  332.         :END                             // 12: Label for goto command
  333.  
  334.     This script uses two "if()" tests, three labels (":NEXT", ":TEXT", and 
  335.     ":END"), and four "goto" commands.  Processing flows along one of three 
  336.     possible paths depending on the user's hardware, with the result that in 
  337.     just 12 simple lines we can ensure that if the user clicks on a certain 
  338.     Graphic linkword he will actually see something.  The next chapter tells
  339.     about other conditions you can test, and gives a full explanation of how
  340.     to use each of the commands illustrated here.
  341.  
  342.     PARAMETERS
  343.     With the sole exception of "goto", all OCL commands must be followed by
  344.     parentheses, which usually enclose one or more parameters.  The number and 
  345.     order of parameters are specific to each command, so before you use a 
  346.     command for the first time you should read its entry in the Programming 
  347.     Command Reference (Chapter 3).  In the following example, trymode() takes 
  348.     a numeric parameter, if() takes a symbolic parameter (a keyword), 
  349.     message() takes a text parameter, and quit() takes no parameter. 
  350.     
  351.         trymode (16)                     // 1: Can we do EGA mode 16?
  352.         if (okay) goto END               // 2: If so, go to line 5. 
  353.         message (This book requires EGA graphics)  // 3: Message box. 
  354.         quit ()                          // 4: Exit the Orpheus Reader. 
  355.         :END                             // 5: Label for goto. 
  356.  
  357.  
  358.  
  359.                                        6
  360.  
  361.  
  362.  
  363.     
  364.     (This script is one that would go in an Init off the Homecard, in a book 
  365.     with a large number of EGA graphics at critical locations.  If the user 
  366.     has an EGA-capable display he will proceed without even knowing that this 
  367.     script was processed.  If he has a CGA or monochrome display, he will see 
  368.     a message box with the message in it, and when he presses a key the 
  369.     program will harmlessly exit.) 
  370.  
  371.     VARIABLES 
  372.     Variables are objects in memory that can hold values or other data.  
  373.     Sometimes values are indicated with numbers, and sometimes they are 
  374.     indicated symbolically using keywords.  The trymode() command sets an 
  375.     internal variable to either "failed" or "okay" depending on whether the 
  376.     user's display can or cannot switch to the specified video mode.  These 
  377.     are symbolic values; in this case, the variable is unnamed.  Most 
  378.     variables however do have names, and the set() command lets us assign 
  379.     values to them, either with a number of with a keyword. 
  380.      
  381.                 set (fadein=venetian, fadeout=venetian, delay=1) 
  382.  
  383.     In this example, the first two variables are assigned the same symbolic 
  384.     value, "venetian", which refers to a style of fading a graphic on or off 
  385.     the screen.  The third variable is assigned a number representing the 
  386.     delay factor for this effect; if delay=0 the fade is rather fast, while if 
  387.     delay=3 the fade is rather slow. 
  388.  
  389.  
  390.  Testing Commands & Scripts
  391.  
  392.         Most commands can be performed within OH.EXE as they would be in the 
  393.     Orpheus Reader.  Those that cannot are at least checked for errors, and a 
  394.     report given accordingly.  To test an individual command line, place the 
  395.     cursor on that line and press <Alt-G>.  This is an easy way to see if you 
  396.     are specifying the right video mode for a graphic() command, or to hear a 
  397.     performance of a music string.  In the case of a graphic() or ansi() 
  398.     command, once the image is displayed you need only press a key to return 
  399.     to editing. 
  400.  
  401.         To test a complete script -- the entire sequence of commands in a 
  402.     programmable card -- press <Alt-C> while in that card.  This is the "Check 
  403.     Card" command, which works quite differently when given from a normal text 
  404.     card.  If you use <Alt-C> from an Action or Init card, and if your script 
  405.     includes a command to display a graphic or ansi graphic, you will notice 
  406.     that without a waitfor() command at the end your graphic merely flashes 
  407.     onscreen and then disappears as the Edit window returns.  This is because, 
  408.     as I explained above, when the last command is processed in an Action or 
  409.     Init card control returns immediately to the parent card.
  410.     
  411.         In a Graphic card (which does NOT require a waitfor() line at the 
  412.     end), pressing <Alt-C> gives you the additional ability to create 
  413.     hotspots.  This is explained under the hotspot() entry in the next 
  414.     chapter. 
  415.  
  416.  
  417.  
  418.  
  419.                                        7
  420.  
  421.  
  422.  
  423.  
  424.   ---------------------------------------------------------------------------
  425.                    CHAPTER 2  -  CONVERTING PRE-1.30 COMMANDS
  426.   ---------------------------------------------------------------------------
  427.  
  428.  
  429.  
  430.  Commands to be converted: Graphic Commands
  431.                            Run Commands
  432.                            Random Commands
  433.  
  434.  
  435.         All programming commands from versions prior to 1.30 must be
  436.     converted to the new standard, which is described in Chapter 1 and in the
  437.     Command Reference (Chapter 3).  Note that commands no longer have to be
  438.     entered in capital letters.  The principal conversions have to do with
  439.     commands that would have been in Graphic cards.
  440.  
  441.  
  442.  Graphic Commands
  443.  
  444.         The commands FILEPATH=, RESOLUTION=, and MODE= are now combined into
  445.     the graphic() command, which takes from 3 to 5 parameters separated by
  446.     commas.  The following data in the old version:
  447.  
  448.                 FILEPATH=c:\art\bkcover.pcx
  449.                 RESOLUTION=640x200
  450.                 MODE=14
  451.  
  452.     becomes this in the new version:
  453.  
  454.                 graphic(bkcover.pcx, 14, full)
  455.  
  456.     There are three points to notice here.  (1) Instead of specifying the
  457.     complete filepath you should give only the filename.  Although you _can_
  458.     give a complete filepath, this would be compiled into the finished version
  459.     of your work and would be of no use to your readers.  A better technique
  460.     is to store your graphics in a single directory, and tell Orpheus to look
  461.     there using the ORPHEUS environment variable.  (See Appendix C.)
  462.  
  463.     (2) Instead of telling Orpheus what screen resolution to use for your
  464.     graphic, with the video mode being an optional detail for PCX files, you
  465.     now specify only the video mode.  The table of Modes and Resolutions in
  466.     online Help makes it easy to find an appropriate mode, and you can test
  467.     the results instantly by placing the cursor on the line with the command
  468.     and pressing <Alt-G>.
  469.  
  470.     (3) Until Version 1.30 you could ONLY display full-screen graphics.  Now
  471.     you can display graphics that are smaller than the screen and place them
  472.     anywhere you want using parameters 3 to 5.  To display a full-screen
  473.     graphic, just use the word "full" as in the example above.  Read Appendix
  474.     F to learn about displaying smaller graphics.
  475.  
  476.  
  477.  
  478.  
  479.                                        8
  480.  
  481.  
  482.  
  483.  
  484.         The commands HOTSPOT= and LINKWORD= are now combined into the
  485.     hotspot() command.  This command takes the linkword as the first
  486.     parameter, with the hotspot data string as the second parameter.  Note
  487.     that when you draw a hotspot on a graphic, Orpheus enters the hotspot()
  488.     command for you automatically along with the hotspot data, the same as it
  489.     did in previous versions.  But if you have existing hotspots and want to
  490.     convert them to the new standard instead of deleting them, you will need
  491.     to read the following.
  492.  
  493.         Suppose you have a graphic of a Mississippi riverboat, showing a
  494.     gambler on whom you've made a hotspot.  In the old commands you would
  495.     have something like:
  496.  
  497.             HOTSPOT=5Q&6Q(7P*8P+9P+9[":O/;O0<N2=N2>U,?U#?Y(@[&■
  498.             LINKWORD=gambler
  499.  
  500.     In the new version this must become:
  501.  
  502.             hotspot( gambler, ■5Q&6Q(7P*8P+9P+9[":O/;O0<N2=N2>U,?U#?Y(@[&■)
  503.  
  504.     To convert old data to new, begin by typing the following (not indented
  505.     as shown here, but starting at the far left on your screen):
  506.  
  507.             hotspot(  , ■■)
  508.  
  509.     (If you are reading this onscreen you'll see what is intended, but if
  510.     you have printed this out you may not see the real characters that are
  511.     intended to go before the closing parenthesis.  These are two little
  512.     square boxes, which are ascii character 254.  You can enter them at
  513.     the keyboard by holding down the Alt key, typing 254 on the Number Keypad,
  514.     then releasing the Alt key. Or you can enter them in Orpheus by using
  515.     the Ascii Table, Alt-A.)
  516.  
  517.         Now mark your existing hotspot data -- everything between the "=" sign
  518.     and the little square box at the end -- and move it to go between the
  519.     two boxes in your new hotspot command.  (If your data carried over onto
  520.     a second line, the second line would have been padded with several "="
  521.     characters at the left margin.  Be sure to delete these and replace them
  522.     with spaces.)
  523.  
  524.         After you moved the hotspot data, mark your linkword and move it
  525.     into the space between "hotspot(" and the comma.  Now erase the old
  526.     commands and you should be done.
  527.  
  528.         NOTE:  previous versions of Orpheus simply ignored hotspot commands
  529.     for which the linkword command did not actually have a linkword with a
  530.     completed link on it.  As of Version 1.30, Orpheus considers this an
  531.     incomplete command and will not let you use the Alt-C command to perform
  532.     the script and create new hotspots.  To bypass this without deleting
  533.     the command, comment it out by placing a ";" or "/" at the beginning of
  534.     the line.
  535.  
  536.  
  537.  
  538.  
  539.                                        9
  540.  
  541.  
  542.  
  543.  
  544.         Finally, the DRAW= and ERASE= commands (for adjusting the colors used
  545.     while drawing hotspots) have been changed into optional parameters of
  546.     the new set() command.  Thus, if you used the following before:
  547.  
  548.             DRAW=14         // draw in yellow
  549.             ERASE=1         // erase in blue
  550.  
  551.     you would now use the following:
  552.  
  553.             set(draw=14, erase=1)
  554.  
  555.  
  556.  Run Commands
  557.  
  558.         The RUN= and RUNBAT= commands now use parentheses in place of the "="
  559.     sign.  If you have a line like:
  560.  
  561.             RUN=print file.doc
  562.  
  563.     you would convert it to:
  564.  
  565.             run(print file.doc)
  566.  
  567.  
  568.  Random Commands
  569.  
  570.         The RANDOM= commands have been replaced by the more capable jump()
  571.     and jumplist() commands.
  572.  
  573.             RANDOM=ALL                      becomes:
  574.             jumplist(random, all)
  575.  
  576.             RANDOM=INCLUDE,00B,01A,...      becomes:
  577.             jumplist(random, include=00B,01A,...)
  578.  
  579.             RANDOM=EXCLUDE,02Z,03G,...      becomes:
  580.             jumplist(random, exclude=02Z,03G,...)
  581.  
  582.             RANDOM=JUMP                     becomes:
  583.             jump(random)
  584.  
  585.     The jump() command in particular has far more useful purposes than the
  586.     above, as you can see in the discussion of it in Chapter 3, the
  587.     Programming Command Reference.
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.                                       10
  600.  
  601.  
  602.  
  603.  
  604.   ---------------------------------------------------------------------------
  605.                   CHAPTER 3  -  PROGRAMMING COMMAND REFERENCE
  606.   ---------------------------------------------------------------------------
  607.  
  608.  
  609.  
  610.  Commands in this reference:  :[label]           message
  611.                               ansi               netwk
  612.                               goto               play
  613.                               graphic            quit
  614.                               hide               run
  615.                               hotspot            runbat
  616.                               if                 set
  617.                               jump               trymode
  618.                               jumplist           waitfor
  619.  
  620.  
  621.  
  622.         This chapter provides extensive discussion of every command in the
  623.     Orpheus Command Language.  For a general introduction to programming in
  624.     Orpheus, see Chapter 1.
  625.  
  626.  
  627.  :[label]
  628.  
  629.         Lines beginning with ":" are considered label lines, with the word
  630.     immediately following being a label for use in flow control.  As in DOS
  631.     batch files, labels are used with the goto command to control the flow
  632.     of processing.  The following example checks for a monochrome display,
  633.     and if one is detected directs processing to the ":END" label, which in
  634.     this case is the end of the script.  If a mono display is not detected,
  635.     processing continues to the next lines, which display a graphic and then
  636.     wait for the user to press a key.
  637.  
  638.                 if (mono) goto END
  639.                 graphic(mypic.pcx, 5, full)
  640.                 waitfor()
  641.                 :END
  642.  
  643.     Labels can be whatever you wish, but to avoid confusion you should
  644.     avoid using commands or keywords belonging to Orpheus Command Language.
  645.     A label is a single word, or multiple words joined by hyphen or
  646.     underscore, such as "first-part" or "has_vga".
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.                                       11
  660.  
  661.  
  662.  
  663.  
  664.  Ansi()
  665.  
  666.         Display a text file containing ANSI escape sequences for color
  667.     effects.  Parameters:  1 (the filename).
  668.  
  669.                 ansi(ansi_pic.ans)
  670.  
  671.     Ansi files may be located in either of two locations, depending on whether
  672.     OH.EXE or the Orpheus Reader is looking for them.  OH.EXE looks first
  673.     in the current directory, the one containing the Homecard.  The Reader
  674.     looks first in whichever directory contains the rest of the book files
  675.     (normally the current directory unless specified on the command line).
  676.     If the ansi file is not found there, Orpheus then checks for an ORPHEUS
  677.     environment variable, and if one exists uses the directory specified
  678.     there.  (See Appendix C, "Using the ORPHEUS Environment Variable".)
  679.  
  680.  
  681.  Goto
  682.  
  683.         Direct command processing to the label following the goto command.
  684.     Goto may be used in two circumstances:  on the same line as an if() test,
  685.     and on a line of its own.
  686.  
  687.                 trymode(18)
  688.                 if (failed) goto DO_ANSI
  689.                 graphic(big_pic.pcx, 18, full)
  690.                 goto END
  691.                 :DO_ANSI
  692.                 ansi(ansipic.ans)
  693.                 :END
  694.  
  695.     This example checks whether the user's display can switch to mode 18,
  696.     a VGA mode.  If it can't, the first goto directs the flow to the :DO_ANSI
  697.     label.  If it can, a graphic is displayed and then the second goto
  698.     directs the flow to the :END label.  Note that goto can direct the flow
  699.     to *any* label in the script, regardless of whether the line is above
  700.     or below the goto.
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.                                       12
  720.  
  721.  
  722.  
  723.  
  724.  Graphic()
  725.  
  726.         Display a graphic in one of the image file formats permitted in
  727.     Orpheus.  Parameters:  three for a full-screen graphic, otherwise from
  728.     three to five.  The first parameter is the filename, the second is the
  729.     video mode in which to display it.  If the third parameter is the keyword
  730.     "full", no further parameters are required.  If the third parameter is not
  731.     "full", the third and fourth parameters give the x-y coordinates (column-
  732.     row in pixels) of the origin of the image, while the fifth (required for
  733.     SPR/PPR files only) gives the image width in pixels.
  734.  
  735.         In the following examples, an identical full-screen graphic is shown
  736.     in both PCX and SPR image file formats, using mode 13, which has a
  737.     resolution of 320 columns by 200 rows:
  738.  
  739.                 graphic(example1.pcx, 13, full)
  740.                 graphic(example2.pcx, 13, 0, 0)
  741.                 graphic(example3.spr, 13, full)
  742.                 graphic(example4.spr, 13, 0, 199, 320)
  743.  
  744.  
  745.     PCX FILES
  746.  
  747.         With PCX files an image is considered to originate at the upper left
  748.     corner.  With a full-screen graphic this would be column 0, row 0, as
  749.     shown in example 2 above.  We do not require the image width of a PCX
  750.     file, so there is no fifth parameter.
  751.  
  752.         Let's suppose we have a PCX graphic that is half the size of the
  753.     screen in each dimension.  Since our examples use mode 13 with a
  754.     resolution of 320 x 200, we'll say that our image is 160 pixels across
  755.     by 100 pixels down.  To center this image we would use the following:
  756.  
  757.                 graphic(example5.pcx, 79, 49)
  758.  
  759.     Where did these numbers come from?  We take the horizontal resolution,
  760.     subtract the width of the image, divide by two, then subtract one:
  761.     320-160=160; 160/2=80; 80-1=79.  We subtract 1 because screen coordinates
  762.     are always counted from 0; thus the leftmost pixel coordinate is 0 and
  763.     the rightmost pixel coordinate (in mode 13) is 319.  The same procedure
  764.     works for the vertical dimension.  Take the vertical resolution, subtract
  765.     the height of the image, divide by two, subtract one:  200-100=100;
  766.     100/2=50; 50-1=49.
  767.  
  768.         You won't always know the dimensions of an image nor where you want to
  769.     show it onscreen.  The best way to proceed is to try out different numbers
  770.     and use the <Alt-G> Go Command to view the results.
  771.  
  772.     SPR/PPR FILES
  773.  
  774.         SPR files are captured using the SNAPSHOT utility, which comes with
  775.     the registered version of Orpheus.  PPR files are generated from SPR
  776.  
  777.  
  778.  
  779.                                       13
  780.  
  781.  
  782.  
  783.  
  784.     files using a Fastgraph utility that compresses them.  With SPR and PPR
  785.     files, an image is considered to originate at the LOWER left corner,
  786.     whereas with PCX files it originates at the upper left.  In addition,
  787.     SPR/PPR files require that we give the image width.  This accounts for
  788.     the numbers in example 4:
  789.  
  790.                 graphic(example4.spr, 13, 0, 199, 320)
  791.  
  792.     Since this a full-screen graphic and the resolution is 320 x 200, the
  793.     horizontal component of the lower left corner is pixel column 0, but the
  794.     vertical component is 199 -- 1 less than the vertical resolution.  The
  795.     width of the image is of course 320 pixels.
  796.  
  797.         Let's suppose we have an SPR graphic that is half the size of the
  798.     screen in both dimensions, in other words 160 pixels across by 100 pixels
  799.     down.  We'll center it just like we did with the half-size PCX graphic
  800.     above.  To calculate the column coordinate we follow the same procedure:
  801.     horizontal resolution - width, divided by 2, minus 1, or: 320-160=160;
  802.     160/2=80; 80-1=79.  For the row coordinate however we must proceed
  803.     differently because we're calculating the lower left corner rather than
  804.     the upper left corner.  The procedure is:  vertical resolution - height,
  805.     divided by 2, subtract that from the vertical resolution, minus 1, or:
  806.     200-100=100; 100/2=50; 200-50=150; 150-1=149.  Our command to center the
  807.     image would thus be:
  808.  
  809.                 graphic(example6.spr, 13, 79, 149, 160)
  810.  
  811.         Unless you stick to a single file type and a single video mode, you
  812.     will find it useful to consult a chart of the video modes and their
  813.     screen resolutions.  You can find such a chart in online help, under
  814.     Programming Hypertext->Graphics->Modes & Resolutions.
  815.  
  816.  
  817.  
  818.  
  819.  
  820.  
  821.  
  822.  
  823.  
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.                                       14
  840.  
  841.  
  842.  
  843.  
  844.  Hide()
  845.  
  846.         The hide() command is for use in an Init card when you wish to conceal
  847.     links in its parent card.  The command can be given either with no
  848.     parameters or with an indeterminate sequence of numeric parameters.
  849.  
  850.                 hide()
  851.                 hide(0, 2, 5)
  852.  
  853.     In the first example, ALL links in the parent card are concealed:  if it
  854.     has a More link this fact will not be known by the reader, and if it has
  855.     any linkwords they will look like ordinary text -- and clicking on them
  856.     will have no effect.  In the second example, the More link and the second
  857.     and fifth linkwords are concealed.  To sum up:  using hide() with no
  858.     parameters hides all links in the parent.  Using "0" as a parameter hides
  859.     the More link; other numbers hide the equivalent linkwords as numbered
  860.     sequentially from top to bottom and from left to right down the screen.
  861.  
  862.         The hide() command could be used in a network environment where not
  863.     all readers should have access to branches with sensitive material.  In
  864.     a work with illustrations in VGA color, it could be used to prevent
  865.     users with mono displays from experiencing the frustration of clicking
  866.     on Graphic links and getting no response.  Hide() will also add to the
  867.     repertoire of effects when the Orpheus Command Language extends to
  868.     interactive dialogs and author-created variables.
  869.  
  870.  
  871.  
  872.  
  873.  
  874.  
  875.  
  876.  
  877.  
  878.  
  879.  
  880.  
  881.  
  882.  
  883.  
  884.  
  885.  
  886.  
  887.  
  888.  
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895.  
  896.  
  897.  
  898.  
  899.                                       15
  900.  
  901.  
  902.  
  903.  
  904.  Hotspot()
  905.  
  906.         The hotspot() command defines an area of a graphic that is linked to
  907.     another graphic or text card, much like a linkword in a text card.
  908.     Hotspots may only be created in Graphic cards and with images that are
  909.     displayed in a graphic video mode; they cannot be associated with graphics
  910.     in Action or Init cards, nor can they be made for ansi screens.
  911.  
  912.         There are two parameters:  a linkword, and a coded data string
  913.     beginning and ending with a character having an ascii value of 254.
  914.     (Ascii 254 is a square box-shaped character; if your printer does not
  915.     support high-ascii characters it will print out in this manual as a tilde,
  916.     the  ~  character.)
  917.  
  918.                 hotspot( linkword , ■5Q&6Q(7P*8P+9[":O/;O0>U,?U#?Y(@[&!■)
  919.  
  920.         The hotspot() command, including the coded data string, is entered
  921.     by Orpheus rather than being typed in by you.  The procedure is as
  922.     follows:  assuming you are in a Graphic card with a valid graphic()
  923.     command, place the cursor on an empty line.  Press <Alt-C> to perform
  924.     the entire script, even if it consists only of one graphic() command.
  925.     Orpheus displays the graphic and waits for your input.  Press <H> to
  926.     indicate that you wish to make a hotspot; Orpheus will beep twice in
  927.     acknowledgement.  You can now draw the hotspot by pressing or clicking the
  928.     left mouse button.  To erase an area, press or click the right mouse
  929.     button.  (Neither drawing nor erasing actually alters your original
  930.     hotspot.)  To cancel a partially-drawn hotspot and refresh the screen,
  931.     press <Esc>.  To signal that you have finished the hotspot, press <Enter>.
  932.  
  933.         When you press <Enter> to finish a hotspot, Orpheus returns you to
  934.     the Graphic card where you will now see the new hotspot() command,
  935.     something like this:
  936.  
  937.                 hotspot( linkword , ■........data string.........■)
  938.  
  939.     One final step is required to make the command complete:  using either
  940.     the word "linkword" or a word of your own to replace it, open a link on
  941.     that word (the first parameter in the hotspot() command) to create a new
  942.     linked card.  Two link types are permitted:  Door links and Graphic links.
  943.     Until this step is done the command is not considered complete and Orpheus
  944.     will not carry out an <Alt-C> command in that card.  When it is complete,
  945.     press <Alt-C> and move the mouse pointer over the area where you drew the
  946.     hotspot; notice that the mouse pointer changes shape.
  947.  
  948.         A hotspot can be small and simple, or large and complex; it can even
  949.     be scattered in several unconnected locations.  The size and complexity
  950.     of the hotspot determines the length of the data string forming the
  951.     second parameter.  If the data string is too long to fit on one line,
  952.     Orpheus will carry it over onto one or more subsequent lines.  As in all
  953.     cases where data is carried over, each additional line must be padded
  954.     with one or more leading spaces.  (Orpheus does this automatically, but
  955.     you should know the rule in case you rearrange things manually.)
  956.  
  957.  
  958.  
  959.                                       16
  960.  
  961.  
  962.  
  963.  
  964.         A graphic may have as many hotspots as you can define within the
  965.     50-line workspace of a card.  Additionally, just as you can use flow
  966.     control to provide alternate graphics for different hardware, you can
  967.     provide a different set of hotspots for each graphic -- or use the same
  968.     hotspots for all of them.  In the first example below, we put up either
  969.     a VGA or an EGA graphic, using modes that have a resolution of 320 x 200.
  970.     We then install 2 hotspots which are applicable to both.
  971.  
  972.                 trymode(19)
  973.                 if (failed) goto HAS_EGA
  974.                 graphic(vga_pic.pcx, 19, full)
  975.                 goto ADD_HOTSPOTS
  976.                 :HAS_EGA
  977.                 graphic(ega_pic.pcx, 13, full)
  978.                 :ADD_HOTSPOTS
  979.                 hotspot( link1 , ■.........data string.........■)
  980.                 hotspot( link2 , ■.........data string.........■)
  981.  
  982.         In the next example we will again use a VGA and an EGA graphic, but
  983.     one will use a resolution of 320 x 400 (mode 23), while the other will
  984.     use a resolution of 640 x 350 (mode 16).  We'll suppose that the pictures
  985.     are sufficiently different that each requires its own set of hotspots.
  986.     In order to create the hotspots we must of course press <Alt-C> to
  987.     perform the entire script; this means that at some point we must comment
  988.     out all command lines that do not pertain to the graphic for which we
  989.     wish to create a hotspot.
  990.  
  991.                 /trymode(23)
  992.                 /if (failed) goto HAS_EGA
  993.                 /graphic(vga_pic.pcx, 23, full)
  994.                 /hotspot( link1 , ■.........data string.........■)
  995.                 /hotspot( link2 , ■.........data string.........■)
  996.                 /goto END
  997.                 /:HAS_EGA
  998.                 graphic(ega_pic.pcx, 16, full)
  999.                 hotspot( link1 , ■.........data string.........■)
  1000.  
  1001.                 :END
  1002.  
  1003.     In this example we have already completed our work for the VGA graphic,
  1004.     and have temporarily commented out that section of the script using
  1005.     a "/" character at the beginning of each line.  This ensures that <Alt-C>
  1006.     will perform only the display of the EGA graphic.  The example shows one
  1007.     hotspot completed, with an empty line left where we can create another.
  1008.     When work is completed for both graphics we simply remove the comment
  1009.     characters to return the commented-out lines to the script.
  1010.  
  1011.  
  1012.     MULTIPLE COPIES OF LINKWORDS
  1013.  
  1014.         If you use multiple sets of hotspots for alternate graphics, you will
  1015.     probably want each set of hotspots to use the same links.  Normally in
  1016.  
  1017.  
  1018.  
  1019.                                       17
  1020.  
  1021.  
  1022.  
  1023.  
  1024.     Orpheus it is not permitted to have more than one copy of a linkword; in
  1025.     other words, you can copy the text as often as you like, but only one
  1026.     instance of it can bear the embedded linking codes.  This rule is ignored
  1027.     for Graphic cards in order to allow multiple sets of hotspots to share
  1028.     links.  Note that to delete a linkword copy you must still use the
  1029.     Unlink command on the Link Menu; if a copy is detected, the unlinking
  1030.     procedure will only remove the linking codes from the linkword at the
  1031.     cursor, and will not affect the linked card.
  1032.  
  1033.  
  1034.  If()
  1035.  
  1036.         The if() command lets you test a condition, and either direct control
  1037.     to a specified label if the condition is true, or fall through to the
  1038.     next line if the condition is false.  If() commands must be followed on
  1039.     the same line by a goto with a label.
  1040.  
  1041.                 if (okay) goto ALRIGHT
  1042.  
  1043.     Only one parameter is permitted, from the following list:
  1044.  
  1045.                 okay
  1046.                 failed
  1047.                 mono
  1048.                 color
  1049.  
  1050.     "Okay" and "failed" test an internal flag that is set by the trymode()
  1051.     command (and in future by others).  "Mono" tests whether the user has a
  1052.     monochrome display running in mode 7.  (A monochrome display refers to one
  1053.     on which besides normal and blinking text we can use underline, bright,
  1054.     and reverse video, but not shades.)  "Color" tests whether the user has a
  1055.     true color display, as distinct from a 1-color display capable of showing
  1056.     16 shades.  Other tests will be added in future.
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.  
  1064.  
  1065.  
  1066.  
  1067.  
  1068.  
  1069.  
  1070.  
  1071.  
  1072.  
  1073.  
  1074.  
  1075.  
  1076.  
  1077.  
  1078.  
  1079.                                       18
  1080.  
  1081.  
  1082.  
  1083.  
  1084.  Jump()
  1085.  
  1086.         The jump() command tells the Orpheus Reader to navigate directly to
  1087.     another card, which may be determined at random, by number, or by
  1088.     circumstance.  Jumping automatically terminates processing of the current
  1089.     script; in other words, you cannot jump to another card and then carry
  1090.     on to the next line of the script with the jump() command.
  1091.  
  1092.         A single parameter is permitted, from the following list:
  1093.  
  1094.                 :[card number]
  1095.                 home
  1096.                 random
  1097.                 retrace
  1098.  
  1099.     To force a jump to a particular card, navigate to that card in another
  1100.     window and open the File Menu to view the card's filename.  (This is
  1101.     displayed under the "Save As..." menu item.)  Take the last three
  1102.     characters of that name -- in other words, the file extension, which
  1103.     represents the _number_ of that card -- and use it as the jump() parameter
  1104.     preceded by a colon.  If the destination card's file extension were "00W"
  1105.     this would become:
  1106.  
  1107.                 jump(:00W)
  1108.  
  1109.     Such a command could theoretically be given in any programmable card, but
  1110.     the logical place would be in an Action card, as a replacement for a
  1111.     Crosslink.  Whereas a Crosslink can have only one destination, an Action
  1112.     card can contain a script that tests various things and conditionally
  1113.     jumps to a choice of multiple destinations.  (In future releases the
  1114.     number of conditions to test will increase to give you considerable power
  1115.     and flexibility in this regard.)  Note that you should NEVER force a jump
  1116.     to either an Init or an Action card.
  1117.  
  1118.         To force a jump to the Homecard, use:
  1119.  
  1120.                 jump(home)
  1121.  
  1122.     Random jumps are permitted if you have previously initialized random
  1123.     jumps by using a jumplist() command together with the "random" parameter.
  1124.     To force a jump to a card selected at random, use:
  1125.  
  1126.                 jump(random)
  1127.  
  1128.     Finally, you can force a jump to the PREVIOUS card the reader visited:
  1129.  
  1130.                 jump(retrace)
  1131.  
  1132.     This last is probably the most useful variation of the jump() command.
  1133.     Suppose there are several cards with Crosslinks to the same card.  It
  1134.     would be impractical for that card to contain separate Crosslinks back
  1135.     to each one of them.  Although the user CAN retrace his path by clicking
  1136.  
  1137.  
  1138.  
  1139.                                       19
  1140.  
  1141.  
  1142.  
  1143.  
  1144.     on the Retrace symbol (or by pressing <Backspace> in the Reader or <Left
  1145.     Arrow> in OH.EXE), some users will not know this or will become frustrated
  1146.     by the need to think about whether they have or have not just come through
  1147.     a Crosslink.  The user-friendly solution is to give such a card an Action
  1148.     link using a phrase such as "Go Back" for the linkword; then use the
  1149.     command "jump(retrace)" in the Action card.
  1150.  
  1151.         Jump() commands cannot be simulated in OH.EXE.
  1152.  
  1153.  
  1154.  Jumplist()
  1155.  
  1156.         The jumplist() command sets up a list of cards to which the Orpheus
  1157.     Reader can or cannot jump when given an appropriate jump() command as
  1158.     described in the previous section.  Currently such a list can only be
  1159.     set up for the purpose of making random jumps; a future release will add
  1160.     the ability to set up a list for a guided tour.
  1161.  
  1162.         Two parameters are required, of which the first must for now be the
  1163.     keyword "random".  The second parameter may be "all", or either "include"
  1164.     or "exclude" followed by a list of card numbers represented by their file
  1165.     extensions.  The example below initializes a random jumplist and tells
  1166.     the Orpheus Reader that choices may be made from all of the cards in the
  1167.     book.  Note that this automatically excludes Init and Action cards.
  1168.  
  1169.                 jumplist(random, all)
  1170.  
  1171.     The next example initializes a random jumplist that includes only the
  1172.     cards specified in the list following the "=" sign.  When the Reader
  1173.     encounters a jump(random) command, it will select at random from that
  1174.     list.  Note that the list must not include Init or Action cards.
  1175.  
  1176.                 jumplist(random, include=00A,00B,0GW,.........)
  1177.  
  1178.     The final examples initializes a random jumplist that includes all cards
  1179.     EXCEPT those specified in the list following the "=" sign.  When the
  1180.     Reader encounters a jump(random) command, it will select at random from
  1181.     all cards, rejecting any choice that is on the exclude list; it will also
  1182.     reject any choice that is an Init or Action card.
  1183.  
  1184.                 jumplist(random, exclude=00A,00B,0GW,.........)
  1185.  
  1186.         The string of file extensions, which represent card numbers, must be
  1187.     constructed as shown, with each 3-letter extension separated from the
  1188.     others by a comma, and with the list terminated by a closing parenthesis.
  1189.     If the list carries over to one or more additional lines, each broken line
  1190.     must end with a comma, and each additional line must begin with at least
  1191.     one leading space.
  1192.  
  1193.         The normal place to declare a jumplist is in an Init card.  You can
  1194.     build the list either manually or automatically.  Both procedures require
  1195.     you to start with the Init card with the uncompleted jumplist() command
  1196.  
  1197.  
  1198.  
  1199.                                       20
  1200.  
  1201.  
  1202.  
  1203.  
  1204.     in one window, and then switch to another window to navigate to the
  1205.     various cards that you intend to add to the jumplist.  To do this
  1206.     manually, open the File Menu when in such a card, get the file extension
  1207.     as shown in the "Save As..." field, then switch to the window with your
  1208.     Init card and add the extension to the list.
  1209.  
  1210.         The semi-automatic way to accomplish the same thing requires a couple
  1211.     of setup steps but is then much faster.  First, leave the Init card with
  1212.     the uncompleted jumplist() command in one window, making sure that the
  1213.     cursor is at the end of the line and in the position where the next
  1214.     file extension is to be inserted.  The example below shows this with an
  1215.     underscore representing the position of the cursor:
  1216.  
  1217.                 jumplist(random, include=_
  1218.  
  1219.     Open the Tools Menu and select "Jumplist", then select "List Window" and
  1220.     tell Orpheus which window contains the Init card with the jumplist.  Now
  1221.     switch to another window and navigate to whichever cards you wish to add
  1222.     to the list.  At each such card, press <Alt-F3>.  If the procedure is
  1223.     successful Orpheus will post a message saying "Added to list".  Let us
  1224.     suppose that the first card you add has the extension "0A1".  The example
  1225.     below shows the growing jumplist with the underscore representing the
  1226.     new position of the cursor, which Orpheus has advanced in preparation
  1227.     to receive the next extension.  Of course you will only see this if you
  1228.     switch back to the window with the Init card.
  1229.  
  1230.                 jumplist(random, include=0A1,_
  1231.  
  1232.     Remember that to terminate the list and make the command complete, you
  1233.     must remove the last comma if there is one, and add a closing parenthesis
  1234.     as in the final example.
  1235.  
  1236.                 jumplist(random, include=0A1,0A2,0AT,0B3,0G7,005,00Y)
  1237.  
  1238.  
  1239.  
  1240.  
  1241.  
  1242.  
  1243.  
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.                                       21
  1260.  
  1261.  
  1262.  
  1263.  
  1264.  Message()
  1265.  
  1266.         The message() command lets you display a 1-line message in a standard
  1267.     "Okay" box.  There is 1 parameter, the message to be displayed, which must
  1268.     not exceed 60 characters in length.
  1269.  
  1270.                 message(This book requires a VGA display)
  1271.  
  1272.     The message is posted in a box with the word "Okay" hilited in the lower
  1273.     right corner, and remains until the user presses a key or clicks the
  1274.     mouse.  The message is automatically centered in the box.  Since a ")"
  1275.     character is considered to terminate the command, the message may not
  1276.     include parentheses.
  1277.  
  1278.  
  1279.  Netwk()
  1280.  
  1281.         The netwk() command is for use with specially customized versions of
  1282.     the Orpheus Reader.  It takes an indeterminate number of parameters on
  1283.     a single line, which are passed as a sequence of null-terminated strings
  1284.     preceded by a 1-byte counter giving the number of strings in the sequence.
  1285.     Parameters are comma-delimited.
  1286.  
  1287.  
  1288.  
  1289.  
  1290.  
  1291.  
  1292.  
  1293.  
  1294.  
  1295.  
  1296.  
  1297.  
  1298.  
  1299.  
  1300.  
  1301.  
  1302.  
  1303.  
  1304.  
  1305.  
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319.                                       22
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  Play()
  1325.  
  1326.         The play() command performs 1-voice music on the PC's internal
  1327.     speaker, temporarily suspending other processing until the music is
  1328.     finished.  There is 1 parameter, a music string composed of a sequence of
  1329.     letters and numbers according to the convention described below.  Letters
  1330.     in the music string must be capitalized as shown in the examples.  The
  1331.     music string may include spaces for readability.  A music string may carry
  1332.     over onto one or more additional lines, provided that each broken line
  1333.     ends with a comma and each additional line begins with one or more leading
  1334.     spaces.  The music string must be terminated by a closing parenthesis.
  1335.  
  1336.  
  1337.     MUSIC SYNTAX
  1338.  
  1339.         A to G    Play the specified note in the current octave.
  1340.  
  1341.         #         Append to a note character (A to G) to make that
  1342.                     note sharp.
  1343.  
  1344.         .         Append to a note character or to a sharp (#) to
  1345.                     extend that note by half its length.  Multiple
  1346.                     dots can be used, and each extends the note by
  1347.                     half as much as the previous dot.
  1348.  
  1349.         Ln        Set the length of notes and pauses.  The value
  1350.                     of "n" is a number between 1 and 64, where 1
  1351.                     indicates a whole note, 2 a half note, 4 a quarter
  1352.                     note, and so on.  The default is L4.
  1353.  
  1354.         On        Set the octave for subsequent notes.  The value
  1355.                     of "n" may be a number from 0 to 6 to specify the
  1356.                     octave, or it can be a "+" or "-" character to
  1357.                     increment or decrement the current octave number.
  1358.                     The default is O4, which contains middle C.
  1359.  
  1360.         P         Pause (rest) for the duration specified by the
  1361.                     previous L command.
  1362.  
  1363.         Sn        Set the amount of silence between notes.  The
  1364.                     value of "n" is a number from 0 to 2.  If 0, each
  1365.                     note plays for the full period set by the previous
  1366.                     L command.  If 1, each note plays for 7/8 of that
  1367.                     period.  If 2, each note plays for 3/4 of that
  1368.                     period.  These effects correspond to legato,
  1369.                     normal, and staccato playing styles.  The default
  1370.                     is S1.
  1371.  
  1372.         Tn        Set the tempo of the music (the number of quarter
  1373.                     notes per minute).  The value of "n" is a number
  1374.                     from 32 to 255.  The default is T120.
  1375.  
  1376.  
  1377.  
  1378.  
  1379.                                       23
  1380.  
  1381.  
  1382.  
  1383.  
  1384.         Here are a few examples:
  1385.  
  1386.         /  "Mary Had a Little Lamb"
  1387.         play(T150 L8 EDCDEEE P DDD P EGG P EDCDEEE L16 P L8 EDDEDC)
  1388.  
  1389.         /  Beethoven's Fifth:
  1390.         play(T180 O2 L2 P L8 P GGG L2 D# L24 P L8 P FFF L2 D)
  1391.  
  1392.         /  Simple scale up and down:
  1393.         play(L4 C L8S2 DEFGAB S1L4 O+C O-L8S2 BAGFED L2 C)
  1394.  
  1395.         /  Chromatic scale over two octaves, with the string carried
  1396.         /  over onto a second line
  1397.         play(L16 CC#DD#EFF#GG#AA#B O+ CC#DD#EFF#GG#AA#B O+ L4 C P,
  1398.             L16 C O- BA#AG#GF#FED#DC#C O- BA#AG#GF#FED#DC# L4 C)
  1399.  
  1400.  
  1401.  
  1402.  
  1403.  
  1404.  
  1405.  
  1406.  
  1407.  
  1408.  
  1409.  
  1410.  
  1411.  
  1412.  
  1413.  
  1414.  
  1415.  
  1416.  
  1417.  
  1418.  
  1419.  
  1420.  
  1421.  
  1422.  
  1423.  
  1424.  
  1425.  
  1426.  
  1427.  
  1428.  
  1429.  
  1430.  
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.                                       24
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  Quit()
  1445.  
  1446.         The quit() command tells the Orpheus Reader to exit, the same as if
  1447.     the user had pressed <Alt-X> except that no attempt is made to save
  1448.     configuration, bookmark, or notepad files.  There are no parameters.
  1449.  
  1450.         An obvious use for quit() would be to prevent access to a work in which
  1451.     high-quality graphics were REQUIRED, if the user's display was not capable
  1452.     of displaying those graphics.  For example, the following script would go
  1453.     into an Init off the Homecard; after checking to see whether the user has
  1454.     at least a VGA color display, it either flows through to the rest of the
  1455.     book or displays a message and exits the program.
  1456.  
  1457.                 trymode(18)
  1458.                 if (okay) goto HAS_VGA
  1459.                 :EXIT
  1460.                 message(This book requires a VGA color display)
  1461.                 quit()
  1462.                 :HAS_VGA
  1463.                 if (color) goto READY
  1464.                 goto EXIT
  1465.                 :READY
  1466.  
  1467.     Note how this script uses two different tests, either of which can
  1468.     branch to the exit sequence.  If the user does not have VGA, the script
  1469.     flows through to the quit() command and we exit the program; if the user
  1470.     has VGA but does not have color, the script backs up so that again we
  1471.     flow into the quit() command and exit.  The actual words used for the
  1472.     labels can be anything you like, and do not have to capitalized; I use
  1473.     uppercase labels for readability.
  1474.  
  1475.  
  1476.  
  1477.  
  1478.  
  1479.  
  1480.  
  1481.  
  1482.  
  1483.  
  1484.  
  1485.  
  1486.  
  1487.  
  1488.  
  1489.  
  1490.  
  1491.  
  1492.  
  1493.  
  1494.  
  1495.  
  1496.  
  1497.  
  1498.  
  1499.                                       25
  1500.  
  1501.  
  1502.  
  1503.  
  1504.  Run()
  1505.  
  1506.         The run() command launches an external program having an extension of
  1507.     either EXE or COM.  There is a single parameter consisting of a command
  1508.     line reproduced exactly as you would enter it at the DOS prompt.  The
  1509.     command line may include space-delimited parameters as you would enter
  1510.     them at the DOS prompt.  Since a ")" character is considered to terminate
  1511.     the command line, the latter may not include parentheses.  The run()
  1512.     command must not be used to launch batch files, nor can it be used to
  1513.     run an internal DOS command such as TYPE or COPY.  (See runbat() below.)
  1514.  
  1515.                 /  launch LIST.COM to display README
  1516.                 run(list readme)
  1517.                 /  launch GIFSHOW.EXE to display a sequence of 3 pictures
  1518.                 run(gifshow jupiter.gif saturn.gif neptune.gif)
  1519.                 /  launch EDIT.EXE with no file specified
  1520.                 run(edit)
  1521.  
  1522.  
  1523.  Runbat()
  1524.  
  1525.         The runbat() command launches a batch file or runs an internal DOS
  1526.     command such as TYPE or COPY.  (Internal DOS commands are those for which
  1527.     there is no separate program of the same name and with a COM or EXE
  1528.     extension.  External DOS commands are those which do refer to a separate
  1529.     program, such as MORE.EXE.)  There is a single parameter consisting of a
  1530.     command line reproduced exactly as you would enter it at the DOS prompt.
  1531.     Since a ")" character is considered to terminate the command line, the
  1532.     latter may not include parentheses.  If using runbat() to launch a batch
  1533.     file, the batch file may include calls to internal and external DOS
  1534.     commands as well as to other programs.  Runbat() can also launch programs
  1535.     having a COM or EXE extension, but it takes a little more memory than
  1536.     run(), so it is better to use run() for such programs.
  1537.  
  1538.                 /  launch ORDER.BAT and specify a certain order form
  1539.                 runbat(order book1.frm)
  1540.  
  1541.                 /  tell DOS to print REGISTER.DOC on the printer (1)
  1542.                 runbat(copy register.doc prn)
  1543.  
  1544.                 /  tell DOS to print REGISTER.DOC on the printer (2)
  1545.                 /  note that this version requires the ">" symbol
  1546.                 runbat(type register.doc >prn)
  1547.  
  1548.                 /  launch SEQUENCE.BAT with no parameters
  1549.                 runbat(sequence)
  1550.  
  1551.  
  1552.  
  1553.  
  1554.  
  1555.  
  1556.  
  1557.  
  1558.  
  1559.                                       26
  1560.  
  1561.  
  1562.  
  1563.  
  1564.  Set()
  1565.  
  1566.         The set() command enables you to assign a symbolic or numerical value
  1567.     to a variable.  Parameters consist of one or more "variable=value" phrases
  1568.     and may be as numerous as can fit on one line.  All variables have certain
  1569.     default values that are discussed below; once you have assigned a value
  1570.     to a variable it retains that value until you change it.  Currently only
  1571.     built-in variables may be set, but a future release will enable you to
  1572.     create variables of your own.  The following examples illustrate the use
  1573.     of the set() command:
  1574.  
  1575.                 set(blink=off)
  1576.                 set(draw=1, erase=14)
  1577.                 set(fadein=tunnelin, fadeout=venetian, delay=1)
  1578.  
  1579.     As you can see, some variables receive a numerical value, while others
  1580.     receive a symbolic value represented by a keyword.  The list below
  1581.     explains what the variables mean and what values they can receive.
  1582.  
  1583.     BLINK
  1584.     Blink refers to the appearance of high-intensity background colors
  1585.     when an ansi screen is displayed with the ansi() command.  Normally, such
  1586.     colors do NOT appear as high-intensity backgrounds but rather as areas
  1587.     that blink.  The ability to give the command "set(blink=off)" lets you
  1588.     work with a more exciting color palette in your ansi screens.  You can
  1589.     even use a time delay to show an ansi screen that starts off with blinking
  1590.     areas that suddenly stop and change color:
  1591.  
  1592.                 set(blink=on)      // in case it was set to off earlier
  1593.                 ansi(mypic.ans)    // display with blinking areas
  1594.                 waitfor(18)        // pause 1 second
  1595.                 set(blink=off)     // turn blink into bright backgrounds
  1596.                 ansi(mypic.ans)    // refresh display
  1597.                 waitfor()          // wait for keypress
  1598.  
  1599.     Note that for this effect to work you MUST make the second ansi() call,
  1600.     because Orpheus does not actually change blink when you give the set()
  1601.     command, only when an ansi screen is displayed.
  1602.  
  1603.     DELAY
  1604.     Delay refers to the speed of certain special effects such as fadein and
  1605.     fadeout, discussed below.  The default value of delay is always 0, which
  1606.     results in a reasonably fast effect.  Some special effects are quicker
  1607.     than others, and some are more attractive than others when slowed down.
  1608.     Since the delay setting applies to BOTH fadein and fadeout (and later
  1609.     perhaps to other variables) you may have to change it repeatedly if you
  1610.     are combining special effects in a sequence.  The first example below
  1611.     sets delay to a very slow setting; the second returns it to normal:
  1612.  
  1613.                 set(delay=4)
  1614.                 / .........
  1615.                 set(delay=0)
  1616.  
  1617.  
  1618.  
  1619.                                       27
  1620.  
  1621.  
  1622.  
  1623.  
  1624.     DRAW, ERASE
  1625.     Draw and erase have to do with making hotspots in OH.EXE.  They receive
  1626.     numerical values from 0 to 15, representing color values from black to
  1627.     white as shown in the chart below.  Their default values are draw=15
  1628.     (white), erase=0 (black).  The following example sets draw to yellow,
  1629.     erase to grey:
  1630.  
  1631.                 set(draw=14, erase=7)
  1632.  
  1633.     You only need to change these variables if the colors of a particular
  1634.     graphic made it difficult for you to distinguish between a hotspot in
  1635.     progress and the original graphic.  Finished hotspots do not in any way
  1636.     alter the appearance of a graphic, and references to these variables are
  1637.     not included in the compiled version of a book.
  1638.  
  1639.  
  1640.                     0 black             8 dark grey
  1641.                     1 blue              9 light blue
  1642.                     2 green            10 light green
  1643.                     3 cyan             11 light cyan
  1644.                     4 red              12 light red
  1645.                     5 magenta          13 light magenta
  1646.                     6 brown            14 yellow
  1647.                     7 grey             15 white
  1648.  
  1649.  
  1650.     FADEIN, FADEOUT
  1651.     Fadein and fadeout refer to the style with which a graphic is displayed
  1652.     or erased.  The following styles are available:
  1653.  
  1654.                 normal ........ the default:  replace pixels at random
  1655.                 diagonal ...... splits the screen diagonally
  1656.                 wipe .......... wipes image on or off from left to right
  1657.                 split ......... splits the screen horizontally
  1658.                 unveil ........ like a curtain
  1659.                 venetian ...... like venetian blinds
  1660.                 tunnelin ...... tunnels from outside to center
  1661.                 tunnelout ..... tunnels from center to outside
  1662.                 check ......... checkerboard style
  1663.  
  1664.     Fadein and fadeout are set individually, so you can have your graphics
  1665.     fading in with one style and fading out with another; you can even have a
  1666.     sequence of graphics in which the fade styles change with each graphic.
  1667.     To make this work, bear in mind that a graphic does not fade out until it
  1668.     is about to be replaced -- whether by another graphic, by an ansi screen,
  1669.     or by a text card.  The following sequence varies both the speed and the
  1670.     style of fades:
  1671.  
  1672.                 set(fadein=tunnelin, fadeout=tunnelout, delay=1)
  1673.                 graphic(example1.pcx, 13, full)
  1674.                 waitfor()
  1675.                 set(fadein=diagonal, delay=0)
  1676.  
  1677.  
  1678.  
  1679.                                       28
  1680.  
  1681.  
  1682.  
  1683.  
  1684.                 graphic(example2.pcx, 13, full)
  1685.                 waitfor()
  1686.                 set(fadein=wipe, fadeout=split)
  1687.                 graphic(example3.pcx, 13, full)
  1688.                 set(fadeout=venetian, delay=3)
  1689.                 waitfor()
  1690.  
  1691.     The sequence begins by setting fadein, fadeout and delay for the first
  1692.     graphic.  Before moving on it changes the fadein style for the second
  1693.     graphic.  After displaying the second graphic it changes the fadeout style
  1694.     for it as well as the fadein style for the third graphic.  After that
  1695.     graphic is displayed the fadeout style is changed again, and the delay
  1696.     factor set slow to emphasize the quality of the chosen style.  Note that
  1697.     each graphic is separated by a waitfor() command to ensure that each one
  1698.     stays onscreen until the user presses a key.  (The last waitfor() command
  1699.     would only be necessary in an Init or Action card.)
  1700.  
  1701.  
  1702.  
  1703.  
  1704.  
  1705.  
  1706.  
  1707.  
  1708.  
  1709.  
  1710.  
  1711.  
  1712.  
  1713.  
  1714.  
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720.  
  1721.  
  1722.  
  1723.  
  1724.  
  1725.  
  1726.  
  1727.  
  1728.  
  1729.  
  1730.  
  1731.  
  1732.  
  1733.  
  1734.  
  1735.  
  1736.  
  1737.  
  1738.  
  1739.                                       29
  1740.  
  1741.  
  1742.  
  1743.  
  1744.  Trymode()
  1745.  
  1746.         The trymode() command provides a simple and precise way to determine
  1747.     the capabilities of the user's video hardware.  The single parameter is
  1748.     the number of a video mode.  Trymode() does not actually set the video
  1749.     mode, but rather tests the user's video system to see if it is capable
  1750.     of switching to that mode, and sets an internal flag accordingly.  If
  1751.     the display CAN switch to that mode the flag is set to "okay".  If the
  1752.     display CANNOT switch to that mode the flag is set to "failed".
  1753.  
  1754.                 trymode(16)                 // can we do EGA?
  1755.                 if (failed) goto END
  1756.                 graphic(ega_pic.pcx, 16, full)
  1757.                 :END
  1758.  
  1759.         Use trymode() in terms of the particular graphics you wish to display.
  1760.     The example above shows a script that might go in a Graphic card.
  1761.     Presumably the author first wrote the graphic() command and experimented
  1762.     with the mode parameter until he was sure that mode 16 was needed.  As
  1763.     shown by Table 1, "Modes and Resolutions" (at the end of this guide), mode
  1764.     16 can be handled by EGA/VGA displays, but not by less advanced displays
  1765.     such as the CGA. By controlling the program flow depending on the results
  1766.     of the trymode() test, he can ensure that if the user's hardware cannot
  1767.     display the graphic nothing bad will happen:  the script will harmlessly
  1768.     skip to the end.
  1769.  
  1770.  
  1771.  
  1772.  
  1773.  
  1774.  
  1775.  
  1776.  
  1777.  
  1778.  
  1779.  
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.  
  1787.  
  1788.  
  1789.  
  1790.  
  1791.  
  1792.  
  1793.  
  1794.  
  1795.  
  1796.  
  1797.  
  1798.  
  1799.                                       30
  1800.  
  1801.  
  1802.  
  1803.  
  1804.  Waitfor()
  1805.  
  1806.         The waitfor() command enables you to insert a pause in a script.
  1807.     The optional parameter is a number representing 18ths of a second.  If
  1808.     there is no parameter Orpheus waits until the user presses a key.  If
  1809.     a number is given Orpheus waits that number of 18ths of a second OR until
  1810.     the user presses a key.  In other words, waitfor() gives you an optionally
  1811.     timed pause that can always be broken by a keypress.
  1812.  
  1813.                 /  wait indefinitely until keypress
  1814.                 waitfor()
  1815.                 /  wait 1 second (or until keypress)
  1816.                 waitfor(18)
  1817.                 /  wait 10 seconds (or until keypress)
  1818.                 waitfor(180)
  1819.  
  1820.         If you display graphics or ansi files from Init or Action cards, you
  1821.     will soon notice that you MUST place a waitfor() command at the end of
  1822.     the script.  Otherwise, control returns immediately to the parent card
  1823.     and the image disappears a fraction of a second after it was displayed.
  1824.     This is NOT the case with Graphic cards, where control remains with the
  1825.     last-displayed image in the same manner as with a text card.
  1826.  
  1827.  
  1828.  
  1829.  
  1830.  
  1831.  
  1832.  
  1833.  
  1834.  
  1835.  
  1836.  
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843.  
  1844.  
  1845.  
  1846.  
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852.  
  1853.  
  1854.  
  1855.  
  1856.  
  1857.  
  1858.  
  1859.                                       31
  1860.  
  1861.  
  1862.  
  1863.  
  1864.   ---------------------------------------------------------------------------
  1865.                        TABLE 1  -  MODES AND RESOLUTIONS
  1866.   ---------------------------------------------------------------------------
  1867.  
  1868.  
  1869.  
  1870.         In the chart below, where two numbers are given under "Colors", such 
  1871.     as 16/64, the first figure represents the number of colors that can be 
  1872.     displayed simultaneously; the second figure represents the number of 
  1873.     possible colors in that video mode.  256K means 262,144 possible colors. 
  1874.  
  1875.  
  1876.  
  1877.               Mode   Resolution    Colors      Adapters
  1878.  
  1879.                4      320x200        4         CGA/EGA/VGA/MCGA
  1880.                5      320x200        4         CGA/EGA/VGA/MCGA
  1881.                6      640x200       2/16       CGA/EGA/VGA/MCGA
  1882.                9      320x200       16         Tandy,PCjr
  1883.               12      320x200        2         HGC
  1884.               13      320x200       16         EGA/VGA
  1885.               14      640x200       16         EGA/VGA
  1886.               15      640x350        2         EGA/VGA
  1887.               16      640x350      16/64       EGA/VGA
  1888.               17      640x480       2/256K     VGA/MCGA
  1889.               18      640x480      16/256K     VGA
  1890.               19      320x200     256/256K     VGA/MCGA
  1891.               20      320x200     256/256K     VGA
  1892.               21      320x400     256/256K     VGA
  1893.               22      320x240     256/256K     VGA
  1894.               23      320x480     256/256K     VGA
  1895.  
  1896.  
  1897.  
  1898.  
  1899.  
  1900.  
  1901.  
  1902.  
  1903.  
  1904.  
  1905.  
  1906.  
  1907.  
  1908.  
  1909.  
  1910.  
  1911.  
  1912.  
  1913.  
  1914.  
  1915.  
  1916.  
  1917.  
  1918.  
  1919.                                       32
  1920.  
  1921.